using GraphProcessor;
using IQIGame.Onigao.Logic;

namespace IQIGame.Onigao.GamePlay.Editors
{
    [System.Serializable, NodeMenuItem(LevelEditorConst.Execution + "/" + LevelEditorConst.UpdateTimeEnvShow, typeof(LevelServiceGraph))]
    public class LevelServiceExecutionNode_UpdateTimeEnvShow : LevelServiceExecutionNode
    {
        protected override ServiceExecutionType mServiceType => ServiceExecutionType.UpdateTimeEnvShow;

        public override string name => LevelEditorConst.UpdateTimeEnvShow;
        [LevelServiceEditorCustomProperty(ServiceExecutionType.UpdateTimeEnvShow, "时间(0-23,-1为清除存档)")]
        public int timeHour;

        protected override LevelServiceCustomConfig CreateConfig()
        {
            var rConfig = new LevelServiceExecutionCustom_UpdateTimeEnvShow()
            {
                timeHour = this.timeHour
            };
            return rConfig;
        }

        protected override void OnSync(EditorLevelServiceExecutionConfig newConfig, LevelServiceExecutionNode tempNode)
        {
            if (tempNode is LevelServiceExecutionNode_UpdateTimeEnvShow rNode)
            {
                this.timeHour = rNode.timeHour;
            }
        }
    }
}